package work.tools.deadline
{
	/**
	 * 期限生效时间条件类 
	 * @author zhangfeng
	 * @see Deadline
	 * @see IQualification
	 */
	public class QualificationEndDate implements IQualification
	{
		private var _endDate:Date;
		/**
		 * 期限生效时间条件类 
		 * @param date 期限生效时间
		 * 
		 */
		public function QualificationEndDate(date:Date)
		{
			_endDate=date;
		}
		
		/**
		 * 期限生效时间 
		 * @return 
		 * 
		 */
		public function get endDate():Date
		{
			return _endDate;
		}

		public function set endDate(value:Date):void
		{
			_endDate = value;
		}

		/**
		 * @inheritDoc
		 * 
		 */
		public function execute():Number
		{
			var newDate:Date=new Date();
			var num:Number=(_endDate.time-newDate.time)/86400000;
			return num;
		}
		
		/**
		 * @inheritDoc 
		 * 
		 */
		public function getClassName():String
		{
			return "QualificationEndDate";
		}
	}
}